﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApp1
{
    public partial class Form4 : Form
    {
        public Form4()
        {
            InitializeComponent();
        }

        private void button1_Click(object sender, EventArgs e)
        {
            var bookName = this.bookName.Text;
            var peopleName = this.peopleName.Text;
            var time = this.time.Text;
            DbHelper db = new DbHelper();
            string tianjia = string.Format("insert into Articles(Title,Author,CreatedTime) values ('{0}','{1}',{2})", bookName, peopleName, time);
            db.ExecuteNonQuery(tianjia);
            MessageBox.Show("信息添加成功");
            this.Close();
        }


        private void button2_Click(object sender, EventArgs e)
        {
            this.Close();
        }
    }
}
